# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=freecell-solver
pkgver=6.8.0
pkgrel=1
pkgdesc='A program that automatically solves layouts of Freecell and similar variants of Card Solitaire'
arch=(loong64 x86_64)
url='https://fc-solve.shlomifish.org'
license=(MIT)
depends=(bash)
makedepends=(cmake gperf perl-moo perl-path-tiny perl-template-toolkit python-random2 python-six python-pysol_cards rinutils)
optdepends=('python-random2: for the Python interface' 'python-six: for the Python interface'
            'python-pysol_cards: for the Python interface')
source=(https://fc-solve.shlomifish.org/downloads/fc-solve/$pkgname-$pkgver.tar.xz)
sha256sums=('95f78a4b15d2fa340271fe4fcc5354065968191ba22db0d40e81b291b8d53d32')

build() {
  cmake -B build -S $pkgname-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DFCS_WITH_TEST_SUITE=OFF \
    -DBUILD_STATIC_LIBRARY=OFF
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
  install -Dm644 $pkgname-$pkgver/COPYING.html "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.html
}
